import request from '@/utils/request';

// 获取汰换总部报表
export const getHeadquarterReport = data => request({
  url: '/api/elimination/report/getHeadquarterReport',
  method: 'post',
  data: data
});

// 获取汰换清单
export const getEliChecklist = data => request({
  url: '/api/elimination/report/getEliChecklist',
  method: 'post',
  data: data
});

// 获取商品汰换清单
export const getComEliChecklist = data => request({
  url: '/api/elimination/report/getComEliChecklist',
  method: 'post',
  data: data
});

// 生成汰换清单
export const createEliCityComChecklist = data => request({
  url: '/api/elimination/report/createEliCityComChecklist',
  // responseType: 'blob',
  method: 'post',
  data: data
});

// 导出商品汰换清单
export const exportComEliChecklist = data => request({
  url: '/api/elimination/report/exportComEliChecklist',
  responseType: 'blob',
  method: 'post',
  data: data
});

// 导出底表
export const exportComEliTable = data => request({
  url: '/api/elimination/report/exportComEliTable',
  responseType: 'blob',
  method: 'post',
  data: data
});

// 导入白名单/导入黑名单
export const whiteBlackList = (type, data, fun) => request({
  url: `/api/elimination/${type}`,
  method: 'post',
  data: data,
  onUploadProgress: fun
});

// 下载导入模板
export const downloadTemplate = data => request({
  url: '/api/elimination/download',
  method: 'get',
  responseType: 'blob',
  params: data
});

// 导出错误数据
export const exportErrorData = data => request({
  url: '/api/elimination/exportErrorData',
  method: 'get',
  responseType: 'blob',
  params: data
});

// 错误数据翻页
export const getErrorPage = data => request({
  url: '/api/elimination/getErrorPage',
  method: 'post',
  params: data
});

// 确认导入
export const confirmImport = data => request({
  url: '/api/elimination/confirmImport',
  method: 'post',
  data: data
});

// 跳过
export const skip = data => request({
  url: '/api/elimination/skip',
  method: 'post',
  data: data
});

// 录入新店日期
export const newShopDate = data => request({
  url: '/api/elimination/newShopDate',
  method: 'post',
  data: data
});

// 运营开始
export const calculate = data => request({
  url: '/api/elimination/calculate',
  method: 'post',
  data: data
});

// 大区总审批/城市总审批
export const onAudit = (area, data) => request({
  url: `/api/elimination/${area}Audit`,
  method: 'post',
  data: data
});

// 根据权限获取城市
export const listByRight = data => request({
  url: '/api/city/listByRight',
  method: 'get',
  params: data
});

// 操作回滚
export const rollback = data => request({
  url: '/api/elimination/rollback',
  method: 'post',
  data: data
});
